<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">通用设置</h1>
		</header>
		<div class="mui-content">
			<h5 class="min-title">网络设置</h5>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell" id="sw1">
					移动数据网络下自动加载视频
				</li>
			</ul>
			<h5 class="min-title">更新设置</h5>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell" id="sw2">
					应用启动时检查更新
				</li>
			</ul>
		</div>
		<script src="../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/user.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.plusReady(function() {
				var switchStr = '<div id="dataAutoPlay" class="mui-switch mui-switch-mini">' + 
					'<div class="mui-switch-handle"></div></div>';
				var setting = Common.getUniSetting();
				var $dataAutoPlay = $(switchStr).addClass(setting.dataAutoPlay ? 'mui-active' : '')
					.attr('id', 'autoPlaySwitch');
				var $autoUpdate = $(switchStr).addClass(setting.autoUpdate ? 'mui-active' : '')
					.attr('id', 'autoUpdateSwitch');
				$("#sw1").append($dataAutoPlay);
				$("#sw2").append($autoUpdate);
				mui('.mui-content .mui-switch')['switch']();
				var self = plus.webview.currentWebview();
				self.addEventListener('close', function() {
					Common.uniSetting.dataAutoPlay = $dataAutoPlay.hasClass('mui-active');
					Common.uniSetting.autoUpdate = $autoUpdate.hasClass('mui-active');
					plus.storage.setItem('uniSetting', JSON.stringify(Common.uniSetting));
				})
			})
		</script>
	</body>

</html>